<%-- 
    Document   : sideCalendario
    Created on : 03-mar-2012, 20:38:30
    Author     : sundance
--%>

<%@ page import="java.util.ArrayList" %>
<%@ page import="clases.Recordatorio"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
  <title>Ver Calendario </title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" media="screen" type="text/css" href="/CPYD/interfaz/css/jquery-ui-1.8.17.custom.css"/> 
        <script src="/CPYD/interfaz/javascript/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="/CPYD/interfaz/javascript/jquery.ui.datepicker.js"></script>

    <div id="sidebar" style="margin-right: 90px; height: 300px;">

        <div class="sidemenu">
         <logic:present name="recordatorio">
            <script type="text/javascript">
                var date1 = '<bean:write name="recordatorio" property="fechaInicio" />';
                var date2 = '<bean:write name="recordatorio" property="fechaFin" />';
                var array = date1.split("/");
                var array2 = date2.split("/");
                var i1 = parseInt(array[1])-1;
                var i2 = parseInt(array2[1])-1;
                array[1]=i1+"";
                array2[1]=i2+"";
                var dates = [new Date(array[2],array[1],array[0]), new Date(array2[2],array2[1],array2[0])];
                //var dates2 = [new Date(2012, 1, 10), new Date(2012, 2, 25)];
                $(function(){
      
                    $('#datepicker').datepicker({
                        flat: true,
                        numberOfMonths: [1,1],
                        dateFormat: 'dd/mm/yy',
                        beforeShowDay: highlightDays
                    });
                
            

       
                    function highlightDays(date) {
                        //pintar el rango

                        if ((date.getTime() >= dates[0]) && (date.getTime() <= dates[1])) {
                            return [true, 'ui-state-highlight'];
                        }
                        else{
                            return [true, ''];
                        }
      
                    }   
        
                });
            </script>   
    </logic:present>
            <div id="datepicker"> </div>

            <div>
                <%--    Recordatorio:
                     <logic:iterate name="recordatorios" id="recordatorio" scope="request">
                       ID: <bean:write name="recordatorio" property="id" />
                       Start Date: <bean:write name="recordatorio" property="fechaInicio" />
                       End Date: <bean:write name="recordatorio" property="fechaFin" />
                     </logic:iterate>
                --%> 
                <div class="buttons">
                <a href="javascript:history.back(1)" class="regular" >
                    <img src="interfaz/images/goback.png" alt=""/>
                    Volver Atrás </a>
                </div>

            </div>      
        </div>
    </div>